//我是棋盘组件
import React from "react";
import BoardRow from "../components/BoardRow"
import PropTypes from 'prop-types';
export default class Board extends React.Component {
    static propTypes = {
        onColClick:PropTypes.func
    }

    handleCoclick(row,col){
        this.props.onColClick(row,col)
    }
    render(){
        // const boardList = new Array(15).fill(0);
        const { checkerboard } = this.props
        return (
            <div>
                {
                  checkerboard.map((item,index)=>{
                      return <BoardRow onColClick={this.handleCoclick.bind(this)} cols={item} row={index} key={index}/>
                  })  
                }
            </div>
        )
    }
}